package org.vectrics.recruiter.user.resume.email;

import java.util.Set;

import org.vectrics.user.PhoneNumber;
import org.vectrics.user.PhoneNumberSet;

public abstract class PhoneNumberExtractor {
	abstract public PhoneNumberSet findPhoneNumbersInText(WordList wordList);

	public void checkSubString(Set phoneNumbers, String content, String regExp, int startIndex, int length) {
		if (content.length() >= startIndex + length - 1) {
			String subStr = content.substring(startIndex, startIndex + length - 1);
			if (subStr.matches(regExp)) {
				phoneNumbers.add(new PhoneNumber(subStr));
			}
		}
	}
	
}
